﻿<Window x:Class="TeamProjectManager.Modules.BuildDefinitions.BuildDefinitionUpdateDialog"
        xmlns="http://schemas.microsoft.com/winfx/2006/xaml/presentation"
        xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
        xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" 
        xmlns:d="http://schemas.microsoft.com/expression/blend/2008" 
        mc:Ignorable="d"
        WindowStartupLocation="CenterOwner"
        ShowInTaskbar="False"
        Height="275"
        MinHeight="275"
        Width="640">
    <Grid Margin="5">
        <Grid.RowDefinitions>
            <RowDefinition Height="*" />
            <RowDefinition Height="Auto" />
        </Grid.RowDefinitions>

        <GroupBox Grid.Row="0" Header="Properties">
            <Grid>
                <Grid.RowDefinitions>
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                    <RowDefinition Height="Auto" />
                </Grid.RowDefinitions>
                <Grid.ColumnDefinitions>
                    <ColumnDefinition Width="Auto" />
                    <ColumnDefinition Width="*" />
                </Grid.ColumnDefinitions>

                <CheckBox Grid.Row="0" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" IsChecked="{Binding UpdateQueueStatus}" Content="Status" />
                <ComboBox Grid.Row="0" Grid.Column="1" Margin="5,5,0,0" IsEnabled="{Binding UpdateQueueStatus}">
                    <ComboBoxItem Content="Enabled" IsSelected="{Binding Path=QueueStatus, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Enabled}" />
                    <ComboBoxItem Content="Paused" IsSelected="{Binding Path=QueueStatus, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Paused}" />
                    <ComboBoxItem Content="Disabled" IsSelected="{Binding Path=QueueStatus, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Disabled}" />
                </ComboBox>

                <CheckBox Grid.Row="1" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" IsChecked="{Binding UpdateBuildControllerName}" Content="Build Controller" />
                <ComboBox Grid.Row="1" Grid.Column="1" Margin="5,5,0,0" IsEnabled="{Binding UpdateBuildControllerName}" SelectedItem="{Binding BuildControllerName}" x:Name="buildControllerNameComboBox" />

                <CheckBox Grid.Row="2" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" IsChecked="{Binding UpdateDefaultDropLocation}" Content="Default Drop Location" />
                <TextBox Grid.Row="2" Grid.Column="1" Margin="5,5,0,0" IsEnabled="{Binding UpdateDefaultDropLocation}" Text="{Binding DefaultDropLocation}" />

                <CheckBox Grid.Row="3" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" IsChecked="{Binding UpdateTriggerType}" Content="Trigger" />
                <ComboBox Grid.Row="3" Grid.Column="1" Margin="5,5,0,0" IsEnabled="{Binding UpdateTriggerType}">
                    <ComboBoxItem Content="Manual" IsSelected="{Binding Path=TriggerType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=None}" />
                    <ComboBoxItem Content="Continuous Integration" IsSelected="{Binding Path=TriggerType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=ContinuousIntegration}" />
                    <ComboBoxItem Content="Rolling" IsSelected="{Binding Path=TriggerType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=BatchedContinuousIntegration}" />
                    <ComboBoxItem Content="Gated Check-in" IsSelected="{Binding Path=TriggerType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=GatedCheckIn}" />
                    <ComboBoxItem Content="Batched Gated Check-in" IsSelected="{Binding Path=TriggerType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=BatchedGatedCheckIn}" />
                    <ComboBoxItem Content="Schedule" IsSelected="{Binding Path=TriggerType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=Schedule}" />
                    <ComboBoxItem Content="Schedule (Forced)" IsSelected="{Binding Path=TriggerType, Mode=TwoWay, Converter={StaticResource enumConverter}, ConverterParameter=ScheduleForced}" />
                </ComboBox>

                <CheckBox Grid.Row="4" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" IsChecked="{Binding UpdateContinuousIntegrationQuietPeriod}" Content="CI Quiet Period" />
                <TextBox Grid.Row="4" Grid.Column="1" Margin="5,5,0,0" IsEnabled="{Binding UpdateContinuousIntegrationQuietPeriod}" Text="{Binding ContinuousIntegrationQuietPeriod}" />

                <CheckBox Grid.Row="5" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" IsChecked="{Binding UpdateBatchSize}" Content="Gated Batch Size" />
                <TextBox Grid.Row="5" Grid.Column="1" Margin="5,5,0,0" IsEnabled="{Binding UpdateBatchSize}" Text="{Binding BatchSize}" />

                <CheckBox Grid.Row="6" Grid.Column="0" Margin="0,5,0,0" VerticalAlignment="Center" IsChecked="{Binding UpdateProcessTemplate}" Content="Process Template" />
                <TextBox Grid.Row="6" Grid.Column="1" Margin="5,5,0,0" IsEnabled="{Binding UpdateProcessTemplate}" Text="{Binding ProcessTemplate}" />
            </Grid>
        </GroupBox>

        <StackPanel Grid.Row="1" Orientation="Horizontal" HorizontalAlignment="Right" Margin="0,5,0,0">
            <Button Content="OK" Width="75" x:Name="okButton" Click="okButton_Click" />
            <Button Content="Cancel" IsCancel="True" Margin="5,0,0,0" Width="75" />
        </StackPanel>
    </Grid>
</Window>